﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Hallenberg.SmartClient.Interfaces
{
    public interface IAttributeTypeHandler
    {
        /// <summary>
        /// Returns the .NET Type handled by the implementor of this interface.
        /// </summary>
        Type HandledType { get; }

        /// <summary>
        /// Handles the attribute instance provided as parameter two.
        /// </summary>
        /// <param name="attachedTo">The type the current attributeInstance is attached to.</param>
        /// <param name="attributeInstance">The attribute to handle.</param>
        /// <param name="allAttributes">All attributes on the same level as the attributeInstance. This includes the instance itself.</param>
        /// <returns></returns>
        bool Handle(Type attachedToClass, MethodBase attachedToMethod, Attribute attributeInstance, Attribute[] allAttributes);
    }
}
